package com.example.simple.work.controller;

import com.example.simple.work.entity.User;
import com.example.simple.work.service.IUserService;
import com.example.simple.work.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("users")
public class UserController extends BaseController{

    @Autowired
    private IUserService userService;

    @RequestMapping("login")
    @CrossOrigin
    @ResponseBody
    public JsonResult<Void> login (@RequestBody User user){
        System.out.println(user);
        userService.login(user);
        return new JsonResult<>(OK);
    }

}
